#ifndef OBJECT_H_
#define OBJECT_H_

#include "irrlicht.h"
#include "../Logger.h"

// Facets standard namespace for the game.
namespace Facets {

	using namespace irr;
	
	/**
	 * The game's basic object class. It represents any and all items that have
	 * a specific location and speed in the world. This is anything from people
	 * to monsters to items to even random static geometry such as trees.
	 */
	class Object {
		protected:
			/// Store position
			core::vector3df m_Position;
			
			/// Store direction
			core::vector3df m_Direction;
						
			/** @name Speed members
			* [ Different speeds for different methods of travel: air, land, sea. ]
			*/
			//@{
			s32 m_MoveSpeed;
			s32 m_AirSpeed;
			s32 m_SwimSpeed;
			//@ }

			/// Store turn speed
			float m_turnSpeed;
			
		public:
			/** @name Object Constructors
			 * [ Each constructor takes different parameters, and sets the internal variables to be the same value as the passed ones.]
			 */
			//@{
			/**
			 * @param pos Position of the object.
			 * @param dir Direction of the object.
			 */
			Object(const core::vector3df& pos, core::vector3df dir) :
			m_Position(pos), m_Direction(dir), m_MoveSpeed(0),
			m_AirSpeed(0), m_SwimSpeed(0), m_turnSpeed(0) {
			}
			/**
			 * @param pos Position of the object.
			 * @param dir Direction of the object.
			 * @param ms Move speed, which will factor over to Air and Swim speeds.
			 */
			Object(const core::vector3df& pos, core::vector3df dir, s32 ms) :
				m_Position(pos), m_Direction(dir), m_MoveSpeed(ms),
				m_AirSpeed(ms), m_SwimSpeed(ms), m_turnSpeed(0) {
			}
			/**
			 * @param pos Position of the object.
			 * @param dir Direction of the object.
			 * @param ms Land movement speed.
			 * @param as Air movement speed.
			 * @param ss Swimming movement speed.
			 */
			Object(const core::vector3df& pos, core::vector3df dir, s32 ms, s32 as, s32 ss) :
				m_Position(pos), m_Direction(dir), m_MoveSpeed(ms),
				m_AirSpeed(as), m_SwimSpeed(ss), m_turnSpeed(0) {
			}
			//@ }
			
			virtual void setPosition(const core::vector3df& pos) {
				m_Position = pos;
			}
			
			virtual void setDirection(const core::vector3df& dir) {
				m_Direction = dir;
				m_Direction.normalize();
			}
			
			virtual const core::vector3df& getPosition() const {
				return m_Position;
			}

			virtual const core::vector3df& getDirection() const {
				return m_Direction;
			}
			
			virtual void update(float dt) {
			}
			
			virtual void printLocation() const {
				Logger::Instance()->log("Object location",Logger::VectorToString(m_Position).c_str());
			}

			virtual void setTurnSpeed(const float& spd) {
				m_turnSpeed = spd;
			}
			
			//virtual bool CheckCollision();
			
			/**
			 * Deconstructs the object and clears the RAM used by all of its members.
			 */
			virtual ~Object();
	};
}

#endif /*OBJECT_H_*/
